#ifndef REPORTFILE_H
#define REPORTFILE_H

#include "reportfile_global.h"
#include <QFile>
#include <QTextStream>
#include <QStringList>
#include <QDateTime>
#include "report_file_define.h"

class REPORTFILE_EXPORT ReportFile : public QFile
{
  Q_OBJECT
public:
  ReportFile(QString directory);
  ~ReportFile();
	
	void startReport() { m_activeReport = true; m_report.clear(); }
	QStringList stopReport() { m_activeReport = false; return m_report; }
	QStringList getReportSession();
	QStringList getAllReport() { return readAll(); }

public slots:
	void addLine(const QString&);
	void addLines(const QStringList&);

private:
	QString header() const;
	QStringList readAll();
	QStringList m_report;
	bool m_activeReport;
	QDateTime m_openingHour;
};

#endif
